﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="VoteMulti.ascx.cs" Inherits="CMS_Control_VoteMulti" %>
<div>

    <script type="text/javascript" src="js/block/Studyplay_vote.js"></script>

    <link href="js/block/votecss.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">



        //        $(document).ready(function() {
        //            $("#vttt").study_vote([
        //            { "name": "一般性111", "data": "1", "color": "#000", "art": "ToVoteMulti(1,1,this)" },
        //            { "name": "我不喜欢", "data": "0", "color": "#000", "art": "ToVoteMulti(1,2,this)" },
        //            { "name": "很差", "data": "1", "color": "#000", "art": "ToVoteMulti(1,3,this)" }
        //            ], null);
        //        });

        function SetVoteOption(oid, isremove, hidid) {
            var hdol = document.getElementById(hidid).value;

            if (hdol == "") {
                if (!isremove) {
                    hdol = "," + oid;
                }
            }
            else {
                if (!isremove) {
                    hdol += "," + oid;
                }
            }

            var oidlist = hdol.replace('undefined', '').split(',');

            var oldlist_new = "";
            for (i = 0; i < oidlist.length; i++) {
                if (oid == oidlist[i]) {
                    if (!isremove) {
                        oldlist_new += oid + ",";
                    }
                }
                else {
                    if (oidlist[i] != "")
                        oldlist_new += oidlist[i] + ",";
                }
            }



            document.getElementById(hidid).value = oldlist_new;

        }
        function ToVoteMultiBackStatus(cid, oid, line, html, hidid) {
            line.innerHTML = html;
            line.onclick = function() { ToVoteMulti(cid, oid, line, hidid) };
            line.onmouseover = function() { OnHv(line) };
            line.onmouseout = function() { OutHv(line) };
            SetVoteOption(oid, true, hidid);
        }

        function ToVoteUrl(cid, hidid) {
            var oidlist = document.getElementById(hidid).value;

            if (oidlist == "") {
                Dialog.alert("请选择要投票的项");
            }
            else {

                var diag = new Dialog();
                diag.Width = 200;
                diag.Height = 100;
                diag.Title = "投票确认";
                diag.URL = "Admin/block/VoteConfirm.aspx?cid=" + cid + "&oid=" + oidlist + "&url=" + encodeURI(window.location.href);
                diag.show();
            }
        }
        function ToVoteMulti(cid, oid, line, hidid) {

            line.className = 'outbarClick';
            var html = line.innerHTML;

            line.onclick = function() { ToVoteMultiBackStatus(cid, oid, line, html, hidid); }
            line.onmouseover = function() { };
            line.onmouseout = function() { };
            line.innerHTML = "<b style='width:30px;float:right'>选中</b>";
            SetVoteOption(oid, false, hidid);

        }
        function AlertMsgMulti(Msg) {
            if (Msg != null && Msg != "") {

                Dialog.alert(Msg);
            }
        }
    </script>

    <div style="border-bottom: 1px solid #cccccc; line-height: 50px;">
        <img src="images/toupiao.jpg" />
        <strong style="font-size: 25px">投票 </strong><span style="color: #abcdef; font-size: 12px;
            font-family: 宋体; font-weight: bold">可多选</span>
    </div>
    <asp:Literal ID="LitContent" runat="server"></asp:Literal>
    <%--<br />
    <span style="font-weight: bold; color: Blue">您对本站点的评价是？ </span>
    <div id="vttt">
    </div>
    
     <div style="text-align: right; font-size: 13px;">
        <button class="bluebtn" style='float: right; text-align: left; margin-left: 10px;
            height: 20px; width: 60px; border: none; cursor: hand' onclick="ToVoteUrl('1')">
            投票</button>
    </div>
    <input id="Hidden1" type="hidden" />
    <asp:HiddenField ID="HidOidList" runat="server" />--%>
    <br />
    <br />
</div>
